package com.example.demo.Service.impl;

//         佛祖保佑       永无BUG     永不修改

import com.example.demo.Service.userService;
import com.example.demo.dao.UserDao;
import com.example.demo.pojo.UserDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceimpl implements userService {

    @Autowired
    private UserDao userDao;


    @Override
    public String loginUser(String username) {
        System.out.println(userDao.loginUser(username)+"正在登录");
        return userDao.loginUser(username);
    }

    @Override
    public boolean setUser(UserDO userDO) {
        UserDO userDO1 = userDao.getUserNameByName(userDO.getUsername());
        if(userDO1==null){
            return userDao.setUser(userDO);
        }
        return false;
    }
}
